﻿using System.Diagnostics;

namespace DimensionsHelper.LanguageService.Syntax;

public class MetadataPrecision : MetadataSingleArgumentSuffix<Expression>
{
    internal MetadataPrecision(SyntaxToken declareKeywordToken, SyntaxNode? parent) :
        base(SyntaxKinds.MetadataPrecision,
            declareKeywordToken,
            NodeConverter.ToIdentifier(declareKeywordToken),
            parent)
    {
    }
}


public static partial class NodeFactory
{
    public static MetadataPrecision CreateMetadataPrecision(SyntaxNode? parent,
        SyntaxToken precisionKeywordToken, Expression? value)
    {
        Debug.Assert(precisionKeywordToken.IsNode(SyntaxKinds.PrecisionKeywordToken));
        MetadataPrecision precision = new(precisionKeywordToken, parent);
        return UpdateMetadataSingleArgumentSuffix(precision, value);
    }
}